----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  F:/Dropbox (UBC-Umich)/Research_Projects/Project Javier and Natalia/TFP firm/TFP_firm_data_historical/dataverse_files/code/logs/figure_A6_management_practices.log
  log type:  text
 opened on:  16 Dec 2022, 14:00:36

. *-------------------------------------------------------------------------------
. 
. 
. *Get the phi's from each country for the set of countries for which 
. *---------------------------------------------------------
. clear all

. use year isocode D_A using "${data}/estimates_agg_naics_sales_s1_base_woparent.dta", clear

. keep if year==2016
(296 observations deleted)

. gen D_A_phi=(-1)*D_A*(0.2)

. keep if isocode=="FR" | isocode=="DE" | isocode=="GB" | isocode=="GR" | isocode=="IT" | isocode=="JP" | isocode=="MX" | isocode=="PL" | isocode=="PT" | isocode=="ES" | isocode=
> ="SE"
(16 observations deleted)

. tempfile phi

. save `phi', replace 
(note: file C:\Users\VANESS~1\AppData\Local\Temp\ST_20cc_000008.tmp not found)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_20cc_000008.tmp saved

. 
. 
. *Bring the management practice dataset
. *--------------------------------------------------------- 
. clear all

. import delimited "${data}\wmsdata_2004_2015.csv", encoding(UTF-8) 
(27 vars, 11,702 obs)

. 
. keep if country=="France" | country=="Germany" | country=="Great Britain" | country=="Greece" | country=="Italy" | country=="Japan" | country=="Mexico" | country=="Poland" | co
> untry=="Portugal" | country=="Spain" | country=="Sweden"
(7,604 observations deleted)

. gen isocode="NA"

. replace isocode="FR" if country=="France"
(490 real changes made)

. replace isocode="DE" if country=="Germany"
(430 real changes made)

. replace isocode="GB" if country=="Great Britain"
(889 real changes made)

. replace isocode="GR" if country=="Greece"
(416 real changes made)

. replace isocode="IT" if country=="Italy"
(437 real changes made)

. replace isocode="JP" if country=="Japan"
(127 real changes made)

. replace isocode="MX" if country=="Mexico"
(406 real changes made)

. replace isocode="PL" if country=="Poland"
(238 real changes made)

. replace isocode="PT" if country=="Portugal"
(193 real changes made)

. replace isocode="ES" if country=="Spain"
(214 real changes made)

. replace isocode="SE" if country=="Sweden"
(258 real changes made)

. 
. keep country management employment isocode

. tab employment

    employment |      Freq.     Percent        Cum.
---------------+-----------------------------------
  A) 50 to 100 |        477       11.64       11.64
 B) 101 to 250 |      1,622       39.58       51.22
 C) 251 to 500 |        925       22.57       73.79
D) 501 to 1000 |        531       12.96       86.75
      E) 1000+ |        543       13.25      100.00
---------------+-----------------------------------
         Total |      4,098      100.00

. *Drop small firms 
. drop if employment=="A) 50 to 100" | employment=="B) 101 to 250"
(2,099 observations deleted)

. 
. collapse (mean) management, by(isocode)

. 
. gen xx=management if isocode=="FR" 
(10 missing values generated)

. egen xx_max=max(xx)

. gen management_relative=ln(management)-ln(xx_max)

. drop xx* management

. 
. 
. *Bring phi information
. *--------------------------------------------------------- 
. merge 1:1 isocode using `phi', keepusing(D_A_phi)

    Result                           # of obs.
    -----------------------------------------
    not matched                             0
    matched                                11  (_merge==3)
    -----------------------------------------

. drop _merge

. 
. 
. 
. *Prepate graph 
. *------------------------------------
. gen ss=1

. local abslist "ss"

. local LHS D_A_phi

. local RHS1 management_relative

. local ytitle "{&Delta}`=ustrunescape("\u03D5\u0303")'{sub:n}"

. local xtitle "Average Management Practices"

. 
. 
. reghdfe `LHS' `RHS1', abs(`abslist') 
(MWFE estimator converged in 1 iterations)

HDFE Linear regression                            Number of obs   =         11
Absorbing 1 HDFE group                            F(   1,      9) =       3.47
                                                  Prob > F        =     0.0954
                                                  R-squared       =     0.2783
                                                  Adj R-squared   =     0.1981
                                                  Within R-sq.    =     0.2783
                                                  Root MSE        =     0.1072

-------------------------------------------------------------------------------------
            D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------------+----------------------------------------------------------------
management_relative |   1.651808   .8866569     1.86   0.095    -.3539492    3.657565
              _cons |  -.0654905    .033054    -1.98   0.079    -.1402637    .0092828
-------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
          ss |         1           0           1     |
-----------------------------------------------------+

. mat b = e(b)

. mat V = e(V)

. global c1: display %-03.2fc round(b[1,1],0.001)

. global se1: display %-03.2fc round(sqrt(V[1,1]),0.001)

. global rsq1: display %-03.2fc round(`e(r2)',0.0001)

. 
. display $c1
1.65

. display $se1
.89

. display $rsq1
.28

. 
. 
. global opt1 msymbol(circle_hollow) mlabel(isocode) mlabcolor(red)  msize(smaller) mlabsize(small)

. global opt2 msymbol(square_hollow) mlabel(isocode) mlabcolor(blue) msize(smaller) mlabsize(small)

. two (scatter `LHS' `RHS1', sort $opt1  mcolor(red)) (lfit `LHS' `RHS1', lcolor(red)) (line `RHS1' `RHS1', lcolor(none)) , ylabel(-0.4(0.2)0.2, labsize(medlarge)) xlabel(-0.08(0
> .04)0.04,  labsize(medlarge)) ///
>         title("", size(small)) ytitle("`ytitle'", size(medlarge)) xtitle("`xtitle'", size(medlarge)) graphregion(fcolor(white) lcolor(white)) ///
>         legend(order(2 "R2: $rsq1" ) rows(2) size(medlarge) bplace(se) ring(0) region(lwidth(none))) 
(note:  named style smaller not found in class symbolsize, default attributes used)

. 
.         
. graph export "${rappendix}/fig_A6_management_practices.pdf", replace
(file F:/Dropbox (UBC-Umich)/Research_Projects/Project Javier and Natalia/TFP firm/TFP_firm_data_historical/dataverse_files/results/appendix/fig_A6_management_practices.pdf writt
> en in PDF format)

. 
. 
. log close 
      name:  <unnamed>
       log:  F:/Dropbox (UBC-Umich)/Research_Projects/Project Javier and Natalia/TFP firm/TFP_firm_data_historical/dataverse_files/code/logs/figure_A6_management_practices.log
  log type:  text
 closed on:  16 Dec 2022, 14:00:47
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
